#pragma once
#include <math.h>
#include <iostream>
typedef double real;
#define so_sqrt(a) sqrt(a)
#define so_atan2(y,x) atan2((double) (y),(double) (x))
#define so_sin(a) sin((double) (a))
#define so_cos(a) cos((double) (a))
#define so_min(a,b) ((a)<(b)?(a):(b))
#define so_max(a,b) ((a)>(b)?(a):(b))
#define so_between(a,min,max) so_min(so_max(a,min),max);
#define so_abs(a) ((a)<0?-(a):(a))
#define so_angle(a) ((a)<0?(a)+360:((a)>=360?(a)-360:(a)))
#define so_rad(a) ((a)<0?(a)+2*PI:((a)>=2*PI?(a)-2*PI:(a)))
#define so_stdangle(a) (-(a))
#define so_anglediff(a,b) so_min(so_max(a,b)-so_min(a,b),360-so_max(a,b)+so_min(a,b))
#define PI 3.1415926
#define so_rand(a,b) (rand()%(so_max(a,b)-so_min(a,b)) + so_min(a,b))
real inline distance(int dx,int dy){
    return so_sqrt(dx*dx + dy*dy);
}
real inline distance2(real dx,real dy){
    return dx*dx + dy*dy;
}
#include <Log.h>